class FixFieldsInRecord < ActiveRecord::Migration
  def self.up
    add_column :operations, :record_date, :integer, :null => false, :default => :created_at
    add_column :operations, :updated_at, :datetime, :null => false, :default => :created_at


    change_column :operations, :created_at, :datetime

    remove_column :operations, :operation_type
    remove_column :operations, :name
  end

  def self.down
    remove_column :operations, :record_date, :updated_at

    add_column :operations, :operation_type, :string
    add_column :operations, :name, :string
  end
end
